this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(e,a,i){"use strict";var n=function(e){babelHelpers.inherits(a,e);function a(e){var n;babelHelpers.classCallCheck(this,a);n=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(a).call(this,e));n.setEventNamespace("BX.Landing.UI.Field.Switch");i.Dom.addClass(n.layout,"landing-ui-field-switch");n.value=e.value;n.id="switch_".concat(i.Text.getRandom());n.onValueChangeHandler=i.Type.isFunction(e.onValueChange)?e.onValueChange:function(){};n.label=i.Dom.create("label",{props:{className:"landing-ui-field-switch-label"},attrs:{for:n.id},html:n.title});n.checkbox=i.Dom.create("input",{props:{className:"landing-ui-field-switch-checkbox"},attrs:{type:"checkbox",id:n.id}});n.slider=i.Dom.create("div",{props:{className:"landing-ui-field-switch-slider"}});i.Dom.append(n.checkbox,n.label);i.Dom.append(n.slider,n.label);i.Dom.append(n.label,n.input);n.setValue(n.value);i.Event.bind(n.checkbox,"change",n.onChange.bind(babelHelpers.assertThisInitialized(n)));return n}babelHelpers.createClass(a,[{key:"onChange",value:function e(){this.onValueChangeHandler();this.emit("onChange")}},{key:"setValue",value:function e(a){this.checkbox.checked=i.Text.toBoolean(a)}},{key:"getValue",value:function e(){return i.Text.toBoolean(this.checkbox.checked)}}]);return a}(a.BaseField);e.Switch=n})(this.BX.Landing.UI.Field=this.BX.Landing.UI.Field||{},BX.Landing.UI.Field,BX);
//# sourceMappingURL=switch.bundle.map.js